﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.Base;
using QLBH.DataModel;
using QLBH.ModelInterface;

namespace QLBH.FeatureModel
{
    public class QLNCCModel:IQLNCCModel
    {
        public Guid NCCID { set; get; }
        public String MANCC { set; get; }
        public String TENNCC { set; get; }
        public String MAST { set; get; }
        public String NGUOIDD { set; get; }
        public String CHUC_VU { set; get; }
        public String DIACHI { set; get; }
        public String DIENTHOAI { set; get; }
        public String DIDONG { set; get; }
        public String FAX { set; get; }
        public String EMAIL { set; get; }
        public String WEBSITE { set; get; }
        public String GHICHU { set; get; }
        public DateTime NGAYTAO { set; get; }

        public void InitFromEntity(NHACUNGCAP entity)
        {
            NCCID = entity.NCCUID;
            MANCC = entity.NCCCODE;
            TENNCC = entity.TENNCC;
            MAST = entity.MASOTHUE;
            NGUOIDD = entity.NGUOIDAIDIEN;
            CHUC_VU = entity.CHUCVU;
            DIACHI = entity.DIACHI;
            DIENTHOAI = entity.DIENTHOAI;
            DIDONG = entity.DIDONG;
            FAX = entity.FAX;
            EMAIL = entity.EMAIL;
            WEBSITE = entity.WEBSITE;
            GHICHU = entity.GHICHU;
            NGAYTAO = (DateTime)entity.NGAYTAO;
        }

        public NHACUNGCAP ToEntity()
        {
            NHACUNGCAP entity = new NHACUNGCAP();

            entity.NCCUID = NCCID;
            entity.NCCCODE = MANCC;
            entity.TENNCC = TENNCC;
            entity.MASOTHUE = MAST;
            entity.NGUOIDAIDIEN = NGUOIDD;
            entity.CHUCVU = CHUC_VU;
            entity.DIACHI=DIACHI;
            entity.DIENTHOAI = DIENTHOAI;
            entity.DIDONG = DIDONG;
            entity.FAX = FAX;
            entity.EMAIL = EMAIL;
            entity.WEBSITE = WEBSITE;
            entity.GHICHU = GHICHU;
            entity.NGAYTAO = NGAYTAO;

            return entity;
        }
    }
}
